package cn.hfuu.socket;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author oldliu
 * @since 1.0
 */
public class ChatServer {
    public static void main(String[] args) {
        try {
            ServerSocket st = new ServerSocket(9999);
            System.out.println("服务器启动了");
            while (true) {
                final Socket s = st.accept();//接受连接
                new ChatThread(s).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
